cmake_minimum_required(VERSION 3.16)
project(DataProcessPro)

# 设置 C++ 标准
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

if (MSVC)
    add_compile_options(/EHsc)
    add_compile_options(/utf-8)
endif()


message(STATUS "App Using compiler: ${CMAKE_CXX_COMPILER}")
message(STATUS "App PROJECT_SOURCE_DIR: ${PROJECT_SOURCE_DIR}")
message(STATUS "App PROJECT_SOURCE_DIR: ${CMAKE_CURRENT_SOURCE_DIR}")

include_directories(
    ${PROJECT_SOURCE_DIR}/include
    ${PRO_ROOT}/thirdParty/spdlog-1.15.3/include
)


# 添加子目录

add_subdirectory(library)
# add_subdirectory(app)
enable_testing()

# 保存当前的 BUILD_SHARED_LIBS 值
set(SAVED_BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS})

# 包含 libcurl 子目录
# add_subdirectory(thirdParty/curl)

# add_subdirectory(thirdParty/spdlog-1.15.3)
add_subdirectory(test/ftpTest)
add_subdirectory(test/char2bin)

# set(BUILD_STATIC_LIBS ON CACHE BOOL "Build static libcurl")
# set(BUILD_SHARED_LIBS OFF CACHE BOOL "Build shared libcurl")
# add_subdirectory(thirdParty/curl)

message(STATUS "Root Using compiler: ${CMAKE_CXX_COMPILER}")

# cmake_minimum_required(VERSION 3.16)
# project(DataProcessPro)

# set(CMAKE_CXX_STANDARD 17)

# # 设置输出目录
# set(BIN_OUTPUT_DIR ${CMAKE_SOURCE_DIR}/bin)
# set(LIB_OUTPUT_DIR ${CMAKE_SOURCE_DIR}/lib)

# # 添加源文件
# file(GLOB_RECURSE SRC_FILES
#     ${CMAKE_SOURCE_DIR}/src/*.cpp
#     ${CMAKE_SOURCE_DIR}/csv/*.cpp
# )

# file(GLOB_RECURSE HEADER_FILES
#     ${CMAKE_SOURCE_DIR}/src/*.h
#     ${CMAKE_SOURCE_DIR}/csv/*.h
#     ${CMAKE_SOURCE_DIR}/include/*.h
# )

# # 设置 include 目录
# include_directories(
#     ${CMAKE_SOURCE_DIR}/src
#     ${CMAKE_SOURCE_DIR}/csv
#     ${CMAKE_SOURCE_DIR}/include
# )

# # 动态库（MyLib.dll）
# add_library(MyLib SHARED ${SRC_FILES} ${HEADER_FILES})
# set_target_properties(MyLib PROPERTIES
#     RUNTIME_OUTPUT_DIRECTORY ${BIN_OUTPUT_DIR}
#     LIBRARY_OUTPUT_DIRECTORY ${LIB_OUTPUT_DIR}
#     ARCHIVE_OUTPUT_DIRECTORY ${LIB_OUTPUT_DIR}
# )

# # 静态库（MyLibStatic.a）
# add_library(MyLibStatic STATIC ${SRC_FILES} ${HEADER_FILES})
# set_target_properties(MyLibStatic PROPERTIES
#     ARCHIVE_OUTPUT_DIRECTORY ${LIB_OUTPUT_DIR}
# )

# # 可执行文件（DataProcessPro.exe）
# add_executable(DataProcessPro ${SRC_FILES} ${HEADER_FILES})
# target_link_libraries(DataProcessPro PRIVATE csvProcessStatic)


# #target_include_directories(DataProcessPro PRIVATE ${PROJECT_SOURCE_DIR}/include)
# # target_link_libraries(DataProcessPro PRIVATE MyLib)

# set_target_properties(DataProcessPro PROPERTIES
#     RUNTIME_OUTPUT_DIRECTORY ${BIN_OUTPUT_DIR}
# )

# === 选择链接哪个库 ===
# target_link_libraries(DataProcessPro PRIVATE csvProcessStatic)
# target_link_libraries(DataProcessPro PRIVATE csvProcess)  # ← 如果你想切换为 DLL
